package com.test.cordova.mvp.view;

import android.os.Bundle;
import android.widget.TextView;

import com.test.cordova.R;
import com.test.cordova.mvp.base.BaseMvpActivity;
import com.test.cordova.mvp.contract.MainContract;
import com.test.cordova.mvp.model.MainModelImpl;
import com.test.cordova.mvp.presenter.MainPresenter;

import butterknife.BindView;

/**
 * Created by Administrator on 2019/2/22 0022.
 */

public class MainMvpActivity extends BaseMvpActivity<MainContract.MainModel,MainContract.MainView,MainPresenter> implements MainContract.MainView{

    @BindView(R.id.test_requst)
    public TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter.getData();
    }

    @Override
    public MainModelImpl createModel() {
        return new MainModelImpl();
    }

    @Override
    public MainContract.MainView createView() {
        return this;
    }

    @Override
    public MainPresenter createPresenter() {
        return new MainPresenter();
    }

    @Override
    protected void setListener() {

    }

    @Override
    protected int getLayout() {
        return R.layout.main_mvp_layout;
    }

    @Override
    protected String addTitle() {
        return "MvpMain";
    }

    @Override
    protected boolean isShowBack() {
        return false;
    }


    @Override
    public void setTestTip(String data) {
        textView.setText(data);
    }
}
